package com.le.tester.javaThink.fifth.chapter24_ConcurrentProgramming;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.RejectedExecutionException;

/**
 * createTime：2021/8/18 9:24
 * description：演示RejectedExecutionException
 */
public class MoreTasksAfterShutdown {
    public static void main(String[] args) {
        ExecutorService service = Executors.newSingleThreadExecutor();
        service.execute(new NapTask(1));
        service.shutdown();
        try {
            service.execute(new NapTask(99));
        } catch (RejectedExecutionException e) {
            System.out.println(e.getMessage());
        }
    }
}
